import request from '@/api/request'


const api_name = 'user'

export default{
    // 主页获取商家列表
    getMerchatList(){
        return request({
            url:`/${api_name}/getAllMerchats`,
            method:'get'
        })
    },
    //获取商家商品列表
    getDishList(merId){
        return request({
            url:`/${api_name}/getAllDishes`,
            method:'get',
            params:{merId}
        })
    },
    //插入订单信息
    insertOrders(UserOrderDatas){
        return request({
            url:`/${api_name}/insertOrders`,
            method:'post',
            data:UserOrderDatas
        })
    },
    //获取用户信息
    getUserInfo(userId){
        return request({
            url:`/${api_name}/queryUserInfo`,
            method:'get',
            params:{userId}
        })
    },
    //获取订单信息
    getOrdersList(userId){
        return request({
            url:`/${api_name}/queryOrders`,
            method:'get',
            params:{userId}
        })
    },
    //修改用户信息
    updateUserInfo(User){
        return request({
            url:`/${api_name}/updateUserInfo`,
            method:'put',
            data:User
        })
    }

}